#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int prime(int a)
{
    int i = 0;
    int j = 0;
    int x = 2;
    int y = 1;
    for (x=2;i<=a;x++)
    {
        y = 1;
        for (j=2;j<x;j++)
        {
            if (x % j == 0)
            {
                y = 0;
                break;
            }
        }
        if (y)
            i++;
        if (i == a)
            return x;
    }
   
}
int main()
{
    int a = 0;
    scanf("%d", &a);
    printf("%d\n", prime(a));
    return 0;
}